package com.example.yls.demoa;

import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.AttributeSet;

public class MainActivity extends AppCompatActivity {
    private Myview myview;
    private CircleProgressView circleProgressView;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        circleProgressView=findViewById(R.id.circle_view);
        int progress=100;
        ValueAnimator valueAnimator=ValueAnimator.ofInt(0,progress);
        valueAnimator.setDuration(2500);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                int value= (int) valueAnimator.getAnimatedValue();
               circleProgressView.setProgress(value);
            }
        });

      /*  myview=findViewById(R.id.my_view);
        ValueAnimator valueAnimator=ValueAnimator.ofInt(0,500);
        valueAnimator.setDuration(5000);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
               int value= (int) valueAnimator.getAnimatedValue();
               myview.setCenter(value);

            }
        });
        valueAnimator.start();*/
    }


}
